#ifndef MTYPE_H
#define MTYPE_H
#include <cv.h>
#include <highgui.h>
#include "BlobResult.h"

/************************************************
 *  Number of features: 8
 *  They are:
 *  1) Contrast
 *  2) Dissimilarity
 *  3) Uniformity
 *  4) Inverse difference moment
 *  5) Entropy
 *  6) Correlation
 *  7) Inverse difference
 *  8) Variance
 *
 *************************************************
 *  For the purpose of training stage of Neural
 *  Network, display_ratio determine image size
 *  to screen size in order to display image onto
 *  the screen
 *************************************************
 *
 */
#define FEAT 8              // Number of GLCM features
#define LEVEL 128           // Quantization level
#define WLEVEL 1            // Level of wavelet transform
#define WSIZE 64            // Size of window containing seeds
#define A_SIZE WSIZE*WSIZE
#define DISPLAY_RATIO 2     // Ratio for diplaying on difference screen
#define NUMBAND 2           // Number of Wavelet sub-bands
#define DISTLEVEL 4         // Level of distance of GLCM [0..DISTLEVEL)
#define PI 3.1415926

typedef struct SeedNode
{
    CvPoint pos;    // Upper-left corner of seed box
    int val;        // 1 for germinated, -1 for non-germinated seed
    double len;     // Length of seed arc
    SeedNode (const CvPoint &p, const int v, const double l)
    {
        pos = p;
        val = v;
        len = l;
    }
}SeedNode;

typedef struct ListNode
{
    int x1, x2;
    ListNode *next;
}ListNode;

typedef struct HashNode
{
    float prob;
    ListNode *listnode;
}HashNode;

typedef struct Stat
{
    float con;            // Contrast
    float dis;            // Dissimilarity
    float uni;            // Uniformity
    float idm;            // Inverse difference moment
    float ent;            // Entropy
    float cor;            // Correlation
    float inv;            // Inverse Difference
    float var;            // Covariance
}Stat;

#endif // MTYPE_H
